<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>AutoSqli-CustomTask</title>
<link href="/static/css/zxmk.css" rel="stylesheet" type="text/css"/>
<link rel="shortcut icon" href="static/images/favicon.ico">
<script src="/static/js/core.js" type="text/javascript"></script>
<script src="/static/js/ajax.js" type="text/javascript"></script>
<script src="/static/js/jquery-1.11.3.min.js" type="text/javascript"></script>
<style>

.options_box{position: absolute;top:100px;left: 150px;border-width:1px;border-radius:4px;border-style: solid;border-color: black;width: 300px;font-size: 20px;color: black;background-color: rgba(184, 184, 184, 0);padding: 20px 25px 20px 25px;}
.item_title{float:left;clear: left;width: 120px;}
.radio{float: left;margin-top: 1px; margin-left:10px;width: 20px;height: 20px;}
.input_text{float: left; margin-bottom: 5px;font-size: 20px;}
hr{float: left;clear: both;width: 100%;margin-top: 5px;border-color: black;}
.item{float:left;}
.button{float: left;clear: both;color:white;padding: 10px 20px 10px 20px;border-width: 3px;border-style: solid; border-color: white;border-radius: 4px;margin-left: 80px;margin-top: 40px;font-size: 20px;background-color: green;}
.spider{position: absolute;top: 100px;left: 600px;border-width:1px;border-radius:4px;border-style: solid;border-color: black;width: 600px;padding: 20px 25px 20px 25px;}
#spider_input{float: left;clear: left;font-size: 20px;width: 500px;height: 100px;margin-left: 50px}
#spider_btn{float: left;clear: both;color:white;padding: 10px 20px 10px 20px;border-width: 3px;border-style: solid; border-color: white;border-radius: 4px;margin-left: 80px;margin-top: 40px;font-size: 20px;background-color: green;}
.spider li{float: left;clear: both;}
</style>
<script type="text/javascript">
	function mouseover(element){
		var btn=document.getElementById(element);
		btn.style.backgroundColor="#cc6600";
	}
	function mousedown(element){
		var btn=document.getElementById(element);
		btn.style.backgroundColor="#e0e0e0";
		btn.style.color="black"
	}
	function mouseout(element){
		var btn=document.getElementById(element);
		btn.style.backgroundColor="green";
	}
	function check_form(){
		var url_text=document.getElementById("url_text");
		if (url_text.value==""){
			url_text.placeholder="please input URL.";
			return false;
		}
		return true;
	}
	function start_spider()
{                            
var url_text=document.getElementById('spider_input').value;
if (url_text=="")
{
  alert("爬虫入口URL不能为空");
  return;
}  
var url="spider";                
  var send_content='{"url":"'+document.getElementById("spider_input").value+'"}';
  loadXMLDocByPost(send_content,url,function(){
    if(xmlhttp.readyState==4&&xmlhttp.status==200){
      if(xmlhttp.responseText=="False"){
        alert("爬取出错！");
      }
      else{
      	$(".spider").children("li").remove();
        $(".spider").append(xmlhttp.responseText);
      }
    }
  });
}
</script>
</head>
<body>
<div class="top-nav">
  <div class="w1000 clearfix">
    <a href="/">AutoSqli Tools</a>
    <a href="quickbuild.html" style="font-size:15px;padding-left:200px;">Quickly Bulid</a>
    <a href="customtask.html" style="font-size:15px;padding-left:60px;">Custom Task</a>
    <a href="tasklist.html" style="font-size:15px;padding-left:60px;">Task List</a>
    <a href="success.html" style="font-size:15px;padding-left:60px;">Success List</a>
  </div>
</div>
<p>{{result|safe}}</p>
<div class="options_box">
	<form action="/customtask.html" method="post" enctype="application/json" onsubmit="return check_form()">
		<p class="item_title">URL:</p>
		<textarea class="input_text" rows="5" name="url" id="url_text"></textarea>
		<hr>

		<p class="item_title">getUsers:</p>
		<input class="radio" type="radio" name="getUsers" value="True"/>
		<p class="item" style="color:green;" for="radio1">True</p>
		<input class="radio" type="radio" name="getUsers" checked="checked" value="False" />
		<p class="item" style="color:red;" for="radio2">False</p>
		<hr>

		<p class="item_title">isDba:</p>
		<input class="radio" type="radio" name="isDba" value="True"/>
		<p class="item" style="color:green;">True</p>
		<input class="radio" type="radio" name="isDba" checked="checked" value="False"/>
		<p class="item" style="color:red;">False</p>
		<hr>

		<p class="item_title">getTables:</p>
		<input class="radio" type="radio" name="getTables" value="True"/>
		<p class="item" style="color:green;">True</p>
		<input class="radio"  type="radio" name="getTables" checked="checked" value="False"/>
		<p class="item" style="color:red;">False</p>
		<hr>

		<p class="item_title">getDbs:</p>
		<input class="radio" type="radio" name="getDbs" value="True"/>
		<p class="item" style="color:green;">True</p>
		<input class="radio" type="radio" name="getDbs" checked="checked" value="False"/>
		<p class="item" style="color:red;">False</p>
		<hr>

		<p class="item_title">getColumns:</p>
		<input class="radio" type="radio" name="getColumns" value="True"/>
		<p class="item" style="color:green;">True</p>
		<input class="radio" type="radio" name="getColumns" checked="checked" value="False"/>
		<p class="item" style="color:red;">False</p>
		<hr>

		<p class="item_title">dumpTable:</p>
		<input class="radio" type="radio" name="dumpTable" value="True"/>
		<p class="item" style="color:green;">True</p>
		<input class="radio" type="radio" name="dumpTable" checked="checked" value="False"/>
		<p class="item" style="color:red;">False</p>
		<hr>

		<p class="item_title">dumpAll:</p>
		<input class="radio" type="radio" name="dumpAll" value="True"/>
		<p class="item" style="color:green;">True</p>
		<input class="radio" type="radio" name="dumpAll" checked="checked" value="False"/>
		<p class="item" style="color:red;">False</p>
		<hr>

		<input class="button" id="sub_button" type="submit" value="Start Task"  onmouseout="mouseout('sub_button')" onmouseover="mouseover('sub_button')" onmousedown="mousedown('sub_button')" />
	</form>
</div>
<div class="spider">
<p style="margin-left:50px;font-size:20px;">爬虫入口URL:</p>
<input type="textarea" name="spider_url" id="spider_input">
<input type="button" id="spider_btn" value="Spider" style="margin-left:250px;" onmouseout="mouseout('spider_btn')" onmouseover="mouseover('spider_btn')" onmousedown="mousedown('spider_btn')" onclick="start_spider()">
</div>
</body>
</html>


